<?php
/**************************************************
* PluginLotto.com                                 *
* Copyrights (c) 2005-2010. iZAP                  *
* All rights reserved                             *
***************************************************
* @author iZAP Team "<support@izap.in>"
* @link http://www.izap.in/
* @version {version} $Revision: {revision}
* Under this agreement, No one has rights to sell this script further.
* For more information. Contact "Tarun Jangra<tarun@izap.in>"
* For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
* Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */

global $CONFIG;
$poll    = get_entity($vars['entity']->guid);
$created_by = get_entity($vars['entity']->owner_guid);

$view = func_izap_bridge_view(
        'view/poll',array(
        'plugin' => GLOBAL_IZAP_POLL_PLUGIN,
        'entity' => $poll
        )
);


$action_view = func_izap_bridge_view(
        'view/actions',array(
        'plugin' => GLOBAL_IZAP_POLL_PLUGIN,
        'entity' => $poll
        )
);

$session = func_get_session_byizap($poll->guid);
if(!$session) {
  $action_view .= '<a href="'.func_set_href_byizap(array(
        'plugin' => GLOBAL_IZAP_POLL_PLUGIN,
        'page_owner' => $poll->getOwnerEntity()->username,
        'page' => 'result_only',
        'vars'=> array( $poll->guid ))).'">'.elgg_echo('izap_poll:view_result').'</a>';
}

echo elgg_view('output/entity_row',array(
'entity' => $poll,
'remove_description' => TRUE,
'remove_comments' => TRUE ,
'extra_description'=>  $view,
'extra'=> $action_view,
)
);